package xyz.fuqufyb.aec.controller;

import com.spingcloud.travel.common.JsonResult;
import com.springcloud.travel.entity.Aviation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xyz.fuqufyb.aec.feign.aviation.AviationFeign;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/aviation")
public class SysAviationController {

    @Autowired
    private AviationFeign aviationFeign;

    /**
     * 显示航空数据
     * @param map
     * @return
     */
    @RequestMapping("/table")
    public JsonResult show(@RequestParam Map<String, Object> map){

        //通过aviationFeign调用aviation服务的接口
        List<Aviation> show = aviationFeign.show(map);
        for (Aviation aviation : show) {
            System.out.println(aviation);
        }

        return JsonResult.getJsonResultBySuccess("查询成功",show);
    }

}
